<script>
import StatisticsSlot from '@/template/Statistics/AppStatistics/slot/statistics.vue'
import { mobile } from '@/mixins/mobile'

export default {
  name: 'AppStatisticsV2',
  components: { StatisticsSlot },
  mixins: [mobile({ tabs: 'statistics' })]
}
</script>

<template>
  <div class="custom-body" :style="borderStyle">
    <el-empty v-if="dataList === null || dataList.length === 0" class="body-custom" :image-size="100" />
    <div class="body-custom" :style="bodyStyle">
      <div v-if="showHeader && temp.sfxsbt" class="custom-header">
        <div class="header-body">
          <div v-if="temp.sfsxtb === true" class="header-icon">
            <i :class="temp.tb" />
          </div>
          <div class="header-title">
            <span class="title-span">{{ temp.name }}</span>
          </div>
        </div>
      </div>
      <div
        v-for="(item,index) in dataList"
        :key="'li-'+index"
        class="body-custom-li"
        :style="liStyle"
        @click="callStatisticsBack(item)"
      >
        <div class="custom-li-image">
          <el-image style="height: 100%" :src="baseURL+item.tb" />
        </div>
        <div class="custom-li-title" :style="{ color: item.fontColor, fontSize: item.fontSize + 'px' }">
          <statistics-slot :ids="item.sjly.id" :column="item.number" />
        </div>
        <div class="custom-li-title" :style="{ color: item.titleColor, fontSize: item.titleFontSize + 'px',fontWeight: '600' }">
          {{ item.label }}
        </div>
      </div>
      <div style="clear: both" />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.custom-body {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}
.body-custom {
  width: 100%;
  height: 100%;
  position: relative;
  overflow-x: hidden;
  padding: 5px;
  box-sizing: border-box;
}
.body-custom-li {
  width: 33.33%;
  height: 90px;
  float: left;
  padding: 5px;
  box-sizing: border-box;
  .custom-li-image {
    width: 100%;
    height: 40px;
    text-align: center;
    padding: 4px 0;
    box-sizing: border-box;
  }
  .custom-li-title {
    width: 100%;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 0.9rem;
  }
}
.custom-header {
  width: 100%;
  height: 50px;
  flex: 0 1 auto;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 50px;
  cursor: pointer;
}

.header-body {
  width: 100%;
  height: 51px;
  display: flex;
  flex-flow: row nowrap;
}

.header-icon {
  width: 20px;
  height: 50px;
  flex: 0 1 auto;
  text-align: center;
  color: #409eff;
  font-size: 1.1rem;
}

.header-icon.more {
  width: 50px;
  font-size: 0.9rem;
}

.header-title {
  height: 50px;
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.title-span {
  height: 40px;
  padding: 12px 5px;
  box-sizing: border-box;
  line-height: 40px;
  text-align: center;
  position: relative;
  font-weight: bolder;
}

</style>
